#---------------------------------------------------------------
# Using this Makefile
#
#	To compile your java source (and generate documentation)
#
#	make 
#
#	To clean up your directory (e.g. before submission)
#
#	make clean
#
#---------------------------------------------------------------

JFLAGS=-Djava.compiler=NONE

# This is a rule to convert a file with .java extension
# into a file with a .class extension. The macro $< just
# supplies the name of the file (without the extension) 
# that invoked this rule.

%.class: %.java
	javac $<

Interpreter: Interpreter.class

Interpreter.class: Evaluator.class Parser.class Lexer.class \
                   SyntaxError.class Lexeme.class Token.class

# You'll need the following dependencies when you start implementing the
# Environment class

# Just remove the # at the beginning of the next 5 lines
#Interpreter.class: Environment.class 
#
#Evaluator.class: Environment.class 
#
#Environment.class: Lexeme.class Token.class

Evaluator.class: Parser.class Lexer.class SyntaxError.class Lexeme.class Token.class

TestParser: TestParser.class

TestParser.class: SyntaxError.class Parser.class Lexer.class Lexeme.class Token.class

Parser.class: SyntaxError.class Lexer.class Lexeme.class Token.class

TestLexer: TestLexer.class

scan: TestLexer.class Lexer.class Lexeme.class Token.class

TestLexer.class: SyntaxError.class Lexer.class Lexeme.class Token.class

Lexer.class: SyntaxError.class Lexeme.class Token.class

Lexeme.class: Token.class

# Run javadoc on all hava source files in this directory.
# This rule depends upon the rule named html, which makes the
# html directory if does not already exist.
doc: html 
	javadoc -author -version -d html/ *.java

# Make the html subdirectory.
html:
	mkdir html

# Clean all the class files and documentation out of the directory 
clean:
	rm --force  *.class 
	rm --force -r html
